package infaraway.Factory.Factory.Creator;

import infaraway.Factory.Factory.Product.Pizza;

/**
 * Created by :Infaraway
 * DATE : 2017/4/27
 * Time : 13:18
 * Funtion :
 */
public abstract class PizzaStore {
    public Pizza orderPizza(String pizzaType){
        Pizza pizza;
        pizza = createPizza(pizzaType);

        pizza.prepare();
        pizza.bake();
        pizza.cut();
        pizza.box();

        return pizza;
    }
    // 实例化pizza的责任被放到该方法中，这个方法就类似于工厂
    protected abstract Pizza createPizza(String pizzaType);
}
